//
//  SKComposeMenuButton.swift
//  WeiboProjectYL
//
//  Created by yanli on 16/7/16.
//  Copyright © 2016年 mountainPassCell. All rights reserved.
//

import UIKit

class SKComposeMenuButton: UIButton {

    // 持有跳转的控制器模型
    var composeMenu: SKComposeMenu?
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        //设置
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    //设置
    private func setupUI() {
        titleLabel?.font = UIFont.systemFontOfSize(15)
        setTitleColor(UIColor.grayColor(), forState: .Normal)
        titleLabel?.textAlignment = .Center
    }
    
    
    //  重写highlighted属性  没有高亮状态
    override var highlighted: Bool {
        get {
            return false
        }
        set {
            
        }
    }
    
    
    //  调整子控件布局  调整按钮 文字和图片的位置
    override func layoutSubviews() {
        super.layoutSubviews()
        
        //  设置子控件的宽高
        imageView?.y = 0
        imageView?.width = width
        imageView?.height = width
        
        titleLabel?.x = 0
        titleLabel?.y = width
        titleLabel?.width = width
        titleLabel?.height = height - width
        
        
    }
    
}
